package com.hlf.modules.merchant.order.mapper;

import com.hlf.modules.merchant.order.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderDetailMapper {
    int deleteByPrimaryKey(Long id);

    int insert(OrderDetail record);

    int insertSelective(OrderDetail record);

    OrderDetail selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(OrderDetail record);

    int updateByPrimaryKey(OrderDetail record);

    /**
     * 根据订单id和商品id 查
     * @return
     */
    OrderDetail selectByOrderIdAndGoodsId(@Param("orderId") Long orderId, @Param("goodsId") Long goodsId);

    List<OrderDetail> selectByOrderId(@Param("orderId") Long orderId);

    OrderDetail queryByGoodsIdAndOrderId(@Param("goodsId") Long goodsId, @Param("orderId") Long orderId);
}